import JsonP from 'jsonp'


 class Axios {
  static jsonp(options) {
    return new Promise((resolve, reject) => {
      JsonP(
        options.url,
        {
          params: 'callback'
        },
        function (err, res) {
          if (res.status === 0) {
            typeof resolve === 'function' && resolve(res);
           } 
          else{
            typeof reject === 'function' && reject(res.msg || res.data);
          }
        }
      )
    })
  }
}
export default Axios;